region_words = ['df', 'du', 'free', "内存", "磁盘"]
cmd_words = ['df', 'du', 'free']
hardware_words = ["内存", "磁盘"]

wd_dict = dict()


def build_wdtype_dict():
    for wd in region_words:
        wd_dict[wd] = []
        if wd in cmd_words:
            wd_dict[wd].append('cmd')
        if wd in hardware_words:
            wd_dict[wd].append('hardware')
    return wd_dict


a = build_wdtype_dict()
print(a)
print(a.get('内存'))
